<%@ taglib uri="/WEB-INF/tld/struts-html.tld"   prefix="html"%>

<%@page import="java.util.Iterator,java.util.Set,org.tigris.atlas.quizme.transfer.Answer,org.tigris.atlas.quizme.transfer.Question,org.tigris.atlas.quizme.client.utils.Constants"%>
 <%
			String questionNumber = ""+(((Integer)request.getSession().getAttribute(Constants.QUESTION_INDEX_KEY)).intValue()+1);
		Question q = ((Question)request.getSession().getAttribute(Constants.CURRENT_QUESTION_KEY));
		Boolean multiQuestion = q.getMultiAnswer();
		boolean bMultiQuestion = (multiQuestion==null)?false:multiQuestion.booleanValue();
		java.util.List answers = (java.util.List)request.getSession().getAttribute(Constants.CURRENT_ANSWERS_KEY);
		Iterator i = answers.iterator();
	%>
<div class="tab-page">
		<div id="subPages" class="disabled link-row">
			<table class="wide-table">
				<tr>
					<td width="780"  height="10">
							<H2>Question <%= questionNumber %></H2>
					</td>
				</tr>
			</table>
		</div>
		<B><font size="3"><%= q.getQuestion()  %></font></B><BR><BR>
	<table cellpadding="0" cellspacing="0" border="0">
	<tr>
   <td colspan="2">

	
	<form name="QuestionForm" action="<html:rewrite page='/answerQuestion.do'/>">
	<table>
	
	<% 
		int answerNumber = 0;
		while(i.hasNext()){
			Answer answer = (Answer)i.next();
	%>
	<tr>
		<td><input type="<%= (bMultiQuestion)?"checkbox":"radio" %>" name="<%= "answer"+answerNumber %>"></td>
		<td><font size="2"><%= answer.getAnswer() %></td>
	</tr>
	<%answerNumber++;} %>
	</table>
	</form>
	<table width="780" border="0">
		<tr>
			<td colspan="2">
				<button name="save" id="5" enabledMode="" accesskey="N"
					class="imageButton" type="button"
					onclick="javascript:document.QuestionForm.submit()" onmouseout="javascript:className='imageButton';" onmouseover="javascript:className='activeImageButton';" >
					<IMG src="<html:rewrite page='/images/goto.gif'/>" alt="Next Question"><IMG src="<html:rewrite page='/images/space.gif'/>" height="20" width="1">
					<span class="underline">N</span>ext Question
				</button>
			</td>
		</tr>
	</table>
	
<BR>
</td>
</tr>
</table>